# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
_libname=jsch
pkgname=java-${_libname}
pkgver=0.1.51
pkgrel=1
pkgdesc="A pure Java implementation of SSH2"
arch=('any')
url='http://www.jcraft.com/jsch/'
license=('BSD')
depends=('java-runtime-headless')
makedepends=('apache-ant')
source=(http://downloads.sourceforge.net/project/${_libname}/${_libname}/${pkgver}/${_libname}-${pkgver}.zip)
sha256sums=('c031b863fbbfe861c5365e8cf403b24b2eb5b40d1c112a048a73f87b5e828c30')

build() {
  cd "${srcdir}/${_libname}-${pkgver}"
  ant dist
}

package() {
  install -Dm644 "${srcdir}/${_libname}-${pkgver}/dist/lib/${_libname}-${pkgver}.jar" \
                 "${pkgdir}/usr/share/java/${_libname}-${pkgver}.jar"
  ln -s ${_libname}-${pkgver}.jar "${pkgdir}/usr/share/java/${_libname}.jar"
  install -Dm644 "${srcdir}/${_libname}-${pkgver}/LICENSE.txt" \
                 "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
